<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>1.sessionStorage</title>
	</head>
	<body>
		<h1>练习操作sessionStorage</h1>
		<button onclick="save()">点我存储数据</button>
		<button onclick="read()">点我读取数据</button>
		<button onclick="deleteData()">点我删除数据</button>
		<button onclick="cleaer()">点我清空数据</button>

		<script type="text/javascript" >
			let person = {name:'强哥',age:18}

			function save(){
				sessionStorage.setItem('a','尚硅谷')
			}

			function read(){
				let result = sessionStorage.getItem('d')
				console.log(JSON.parse(result))
				// console.log(result)
			}

			function deleteData(){
				sessionStorage.removeItem('c')
			}

			function cleaer(){
				sessionStorage.clear()
			}

		</script>
	</body>
</html>